home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / apb17.zip / APBTOFP.ASM < prev    next >
Assembly Source File  |  1990-12-20  |  2KB  |  72 lines

  1.     Title ApBasic to Fabs Plus interface sub-program
  2.     Page 60,130
  3.  
  4. Comment *
  5.     Created 10-20-1987 k. murray
  6.  
  7.     FABS PLUS is a excellent BTREE package published by
  8.     Computer Control Systems, Inc. Tele: (904) 752-0912
  9.     They also publish sort/merge system called Autosort/86M.
  10.     For further information contact Comptech or Computer
  11.     Control Systems.
  12.  
  13. *
  14.  
  15. Cseg    Segment byte public 'Code'
  16.     Assume Cs:Cseg,Ds:nothing,Es:nothing
  17. ;
  18. Comment *
  19.     Define in program:
  20.         Sub FabsP Cmd$,Errf%,Recno%,Adrkey%,Fseg% External "ApbToFp.com"
  21.     Call in program:
  22.         FabsP Cmd$,Errf%,RecLo%,Adrkey%,Fseg%
  23.         FabsP "X",Dum%,RcHi%,Dum%,Fseg%
  24.         Recno#=CVL(MKI$(RcLo%)+MKI$(RcHi%))
  25.  
  26.     Stack frame:
  27.     Bp+14    Cmd$ desc #
  28.     Bp+12    Adr. of Errf%
  29.     Bp+10    Adr. of Recno%
  30.     Bp+8    Adr. of Adrkey%
  31.     Bp+6    Adr. of Fseg%
  32.     Bp+4    Return Segment
  33.     Bp+2    Return Offset
  34.     Bp+0    Saved Bp
  35. *
  36. Start:
  37. FabsP Proc Far
  38.     Push    Bp
  39.     Mov    Bp,Sp
  40.     Mov    Bx,[Bp+14]        ; Get desc # of Cmd$
  41.     Shl    Bx,1
  42.     Shl    Bx,1            ; Mult by 4
  43.     Mov    Es,Ds:[6]        ; Get desc segment
  44.     Mov    Ax,Es:[Bx]        ; get length of string in Ax
  45.     Mov    Es,Es:[Bx+2]        ; Put segment of string in Es
  46.     Push    Es:[0]            ; save reserved area before string
  47.     Push    Ax            ; One extra because FABS remove 14
  48.     Mov    Es:[1],Al        ; put length as byte before string
  49.     Push    Es            ; push segment of string data
  50.     Mov    Ax,1
  51.     Push    Ax            ; offset of string (1)
  52.     Push    Ds            ; segment of ErCode%
  53.     Push    [Bp+12]            ; Offset of ErCode%
  54.     Push    Ds            ; segment of Adrkey%
  55.     Push    [Bp+8]            ; offset of Adrkey%
  56.     Mov    Bx,[Bp+6]        ; Adr. of Fseg%
  57.     Mov    Ax,[Bx]            ; Fseg% into Ax
  58.     Mov    word ptr Cs:Fseg+2,Ax    ; put segment into local variable
  59.     Call    dword ptr Cs:Fseg    ; do call to Fabs Plus
  60.     Mov    Bx,[Bp+10]        ; adr. to put Recno%
  61.     Mov    [Bx],Ax            ; save returned Recno%
  62.     Pop    Es:[0]            ; restore reserved area
  63.     Pop    Bp
  64.     Ret    5*2            ; Five parm's at 2 bytes/parm
  65. FabsP    Endp
  66. ;
  67. ;    Local data goes here
  68. Fseg    Dw    23,0
  69. ;
  70. Cseg    Ends
  71.     End    Start
  72.